-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support kCMPixelFormat_32BGRA and add github action for running tests #1
base: 0.10
Are you sure you want to change the base?
Conversation
nokhwa-core/src/pixel_format.rs
Outdated
@@ -405,9 +496,10 @@ impl FormatDecoder for LumaAFormat { | |||
/// let image: ImageBuffer<Rgb<u8>, Vec<u8>> = buffer.to_image::<YuyvFormat>(); | |||
/// ``` | |||
#[derive(Copy, Clone, Debug, Default, Hash, Ord, PartialOrd, Eq, PartialEq)] | |||
pub struct YuyvFormat; | |||
pub struct I420Format; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was never YUYV it was always meant to be i420
.github/workflows/examples.yml
Outdated
@@ -29,4 +29,4 @@ jobs: | |||
- name: Cargo Check | |||
run: | | |||
cd examples/threaded-capture | |||
cargo check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
2 => Mat::new_rows_cols_with_data::<GA8>(resolution.width() as i32, resolution.height() as i32, cast_slice(data)), | ||
3 => Mat::new_rows_cols_with_data::<RGB8>(resolution.width() as i32, resolution.height() as i32, cast_slice(data)), | ||
4 => Mat::new_rows_cols_with_data::<RGBA8>(resolution.width() as i32, resolution.height() as i32, cast_slice(data)), | ||
1 => Mat::new_rows_cols_with_data::<G8>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just cargo fmt
use crate::error::NokhwaError; | ||
use crate::pixel_format::FormatDecoder; | ||
use crate::types::{FrameFormat, Resolution}; | ||
use bytemuck::{cast_slice, Pod, Zeroable}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more cargo fmt
@@ -77,6 +77,16 @@ impl FormatDecoder for RgbFormat { | |||
.collect()), | |||
FrameFormat::RAWRGB => Ok(data.to_vec()), | |||
FrameFormat::NV12 => nv12_to_rgb(resolution, data, false), | |||
FrameFormat::BGRA => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the meat
of the change
@@ -0,0 +1,38 @@ | |||
|
|||
# Assets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documenting how I added the test images and the license for the pyramid picture
No description provided.